package com.krisyu.visitorPattern.template;

import com.krisyu.visitorPattern.vpExpand1_MultiVisitor.ConcreteElement1;
import com.krisyu.visitorPattern.vpExpand1_MultiVisitor.ConcreteElement2;
import com.krisyu.visitorPattern.vpExpand1_MultiVisitor.Element;

import java.util.Random;

/**
 * @Author: Kris
 * @Date: 2022/1/9 - 01 - 09 - 21:04
 * @Description: 元素生产者。用于生产批量元素。
 * @version: 1.0
 */
public class ObjectStructure {
    public static Element createElement(){
        Random random = new Random();
        if(random.nextInt(20) > 10){
            return new ConcreteElement1();
        }else{
            return new ConcreteElement2();
        }
    }
}
